// 导入 express
const express = require('express')
// 创建路由对象
const router = express.Router()
const expressJoi = require('@escook/express-joi')

const articleHandler = require('../routerHandler/article')
const { getArticleDetail } = require('../validate/article')

// 获取文章详情
router.get('/getArticleDetail',expressJoi(getArticleDetail),articleHandler.getArticleDetail)

//获取文章评论
router.get('/getArticleComment',expressJoi(getArticleDetail),articleHandler.getArticleComment)

//添加文章评论
router.post('/addArticleComment',articleHandler.addArticleComment)

//判断文章是否被点赞或者不点赞
router.get('/isLikeArticle',articleHandler.isLikeArticle)

//文章点赞
router.post('/likeArticle',articleHandler.likeArticle)

//判断文章是否被收藏
router.get('/isCollectArticle',articleHandler.isCollectArticle)

//收藏文章
router.post('/collectArticle',articleHandler.collectArticle)

// 向外共享路由对象
module.exports = router